<include file="__TPL__/Common/header.html"/>

	<link rel="stylesheet" href="__TPL__/Public/Css/css-common.css" />
	<link rel="stylesheet" href="__TPL__/Public/Css/header.css" />
	<link rel="stylesheet" href="__TPL__/Public/Css/foot.css" />
	<link rel="stylesheet" href="__TPL__/Public/Css/login.css" />
	<script type="text/javascript" src="__TPL__/Public/Js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="__TPL__/Public/Js/table.js"></script>
	<script type="text/javascript" src="__TPL__/Public/Js/common.js"></script>
		<!-- 载入less文件 -->
	<link rel="stylesheet/less" href="__TPL__/Public/Css/chooseseat.less" />
	<!-- 载入less.js -->
	<script type="text/javascript" src="__TPL__/Public/Js/less-1.5.0.min.js"></script>
	<title>Document</title>
</head>
<body>
<div id="choose-seat" class="Swd">
	<div class="screen FL">
		<img src="__TPL__/Public/Images/seat-des.png" alt="" />
		<ul class="seat FL">
			<li>
			<!-- 座位 -->
					<foreach from="$priceData" key="$k" value="$v">
					<a href="javascript:;" class="seat choose-seat-ti" key="{$k}" goodstimeid="{$v.goodstimeid}" goodsprice="{$v.goodsprice}" goodsid="{$goodsData['goodsid']}" title="座位：{$v.seatsort}--价格：{$v.price}元" price="{$v.price}" seartsort="{$v.seatsort}" click="true"></a>
					</foreach>
			</li>
		</ul>
	</div>
	<script type="text/javascript">
	$(function(){
		$('.choose-seat-ti').toggle(function() {
			//最多只能有4个SPAN标签，如果多于3个，就提示
			if($('.seat-choose span').length >3)
			{
				alert('最多只能选4个位')
				return false;	
			} 
			if($(this).attr('click')=='true')
			{
				$(this).addClass('c-seat')
				//当前的价格
				var price = $(this).attr('price');
				// alert(price);
				// 当前的座位号
				var seatsort = $(this).attr('seartsort');
				//当前时间ID
				var goodstimeid = $(this).attr('goodstimeid');
				//当前的商品ID
				var goodsid = $(this).attr('goodsid');
				//当前的价格ID
				var goodsprice = $(this).attr('goodsprice');
				//循环的当前KEY值 
				var key = $(this).attr('key');
				//定义一个字符串
				var str = '';
				//组合字符
				str = "<span class='key"+key+"'>"+seatsort+"</span>";
				str+="<input type='hidden' name='goodsid[]' value='"+goodsid+"' />";
				str+="<input type='hidden' name='goodsprice[]' value='"+goodsprice+"' />";
				str+="<input type='hidden' name='goodstimeid[]' value='"+goodstimeid+"' />";
				str+="<input type='hidden' name='seatsort[]' value='"+seatsort+"' />";
				$('.seat-choose').append(str);
				//点击了后，不能再点，把当前的属性变为FALSE
				$(this).attr('click','false');
			}		
		
		}, function() {
			var key = $(this).attr('key');
			var keystr= ".seat-choose .key"+key;
			$(this).removeClass('c-seat')
			$(keystr).remove();
			$(this).attr('click','true');
		});
		

	// 	// var click = true;
	// 	$('.choose-seat-ti').click(function() {
	// 		if($('.seat-choose span').length >3)
	// 		{
	// 			alert('最多只能选4个位')
	// 			return false;	
	// 		} 
	// 		if($(this).attr('click')=='true')
	// 		{
	// 			$(this).addClass('c-seat')
	// 			var price = $(this).attr('price');
	// 			// alert(price);
	// 			var seatsort = $(this).attr('seartsort');
	// 			var goodsid = $(this).attr('goodsid');
	// 			var goodsprice = $(this).attr('goodsprice');
	// 			var key = $(this).attr('key');
	// 			var str = '';
	// 			str = "<span>"+seatsort+"</span>";
	// 			str+="<input type='hidden' name='goodsid' value='"+goodsid+"' />";
	// 			str+="<input type='hidden' name='goodsprice' value='"+goodsprice+"' />";
	// 			$('.seat-choose').append(str);
	// 			$(this).attr('click','false');
	// 		}		
	// 	});
	// 	A标标签控制FROM表单
	 $('#C-seat-bot').click(function() {
	 	$('#seat-but').submit();
	 });
	})


	</script>




	<div class="ticket-info FR">
		<div class="buy-info">您的购票信息：</div>
		<p><span>名称：</span>{$goodsData['title']}</p>
		<p><span>地点：</span>{$seatData['seataddress']}</p>
		<p><span>日期：</span>{$goodstimeData['time']}</p>
	<!-- 	<p><span>场次：</span>14:20</p> -->
		<p style="color:red;">座位：</p>
		<!-- //已选座 -->
	<form action="{|U:'Straightbuy/index'}" method="post" id="seat-but">
		<p class="seat-choose">
			<!-- <span>3排08座</span>
			<span>3排08座</span>
			<span>3排08座</span>
			<span>3排08座</span> -->
		</p>
		<!-- //删除选中的座位 -->

		<p class="sub" ><a href="javascript:;" id="C-seat-bot"></a></p>
		<!-- 未选座 -->
		<!-- <p class="seat-no-choose">
			<u>未选择座位</u>
			<span>请先在左侧选座，每次可选5座</span>
		
		</p> -->
		<!-- <p class="no-sub">
			<a href=""></a>
		</p> -->
	</form>
	</div>
</div>
<include file="__TPL__/Common/footer.html"/>